package gui.processor;

import javax.swing.SwingWorker;

/*Author: John Archer, Contact: john.archer.jpa@gmail.com*/
public class Worker extends SwingWorker<String, String>{
    private Object objectWithTask;
    public Worker(Object obj){objectWithTask = obj;}
    protected String doInBackground(){
        if(objectWithTask.getClass() == Processor.class){
            Processor castedObject = (Processor)objectWithTask;
            castedObject.runTask();
        }
        return "";
    }
}